﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESpace;

namespace ESpace_Project
{
    public partial class FormCompress : Form
    {
        public FormCompress()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            byte[] buf = Cmpr.CompressText(txbText.Text);
            textBox1.Text = Cmpr.DecompressText(buf);
            label1.Text = "размер строки " + (txbText.Text.Length * 2).ToString();
            label1.Text += "\r\nразмер буфера " + buf.Length.ToString();
            label1.Text += "\r\nужато на " + Math.Round((100.0 - (buf.Length / (double)(txbText.Text.Length * 2) * 100.0)), 2).ToString() + "%";

        }
    }
}
